#include "../src/IFUException.h"
#include "../src/FITSException.h"

#include "../src/FITSImage.h"
#include "../src/ImageSlice.h"
#include "../src/IFUConf.h"
#include "../src/IFUMap.h"
#include "../src/GaussParameters.h"

#include <stdlib.h>
#include <iostream>

int main(void) {

  try {
    
    IFUConf *conf = new IFUConf("ifu.conf");
    conf->dump();
    delete conf;

    IFUMap *mapa = new IFUMap("ifu.map");
    mapa->dump();
    delete mapa;
    
    FITSImage *img = new FITSImage("ifu.fits");
    cout << img->getPixel(0,0) << endl;
    delete img;

    GaussParameters *gauss = new GaussParameters();
    gauss->add("ph0.par");
    gauss->add("ph1.par");
    delete gauss;

  } catch (FITSException e) {

    cerr << e.getMessage() << endl;
    e.printFitsError();
    exit(1);

  } catch (IFUException e) {
    cerr << e.getLocation() << " :: " << e.getMessage() << endl;
    exit(1);
  }



  return 0;
}
